<ul class="nav nav-tabs tableS container">
    <?php $mortgageIdF = 0;$ppseIdF = 0;?>
    <?php
    if (!empty($mortgageCount) && $mortgageCount>0){
            $i = 1;
            foreach ($mortgageStateList as $k => $v) {
                foreach ($v as $k1 => $v1){
                    $href = "#tab".$i;
                    $name = "抵押物".$i;
                    $mortgageId = $v1['mortgage_id'];
                    $ppseId = $v1['ppesid'];
                    if ($i==1){
                        $mortgageIdF = $mortgageId;
                        $ppseIdF = $ppseId;
                        echo <<<ULLI
    <li class="active">
        <a href="$href" onclick="render($mortgageId,$ppseId)" data-toggle="tab">$name</a>
    </li>
ULLI;
                    }else{
                        echo <<<ULLI2
    <li>
        <a href="$href" onclick="render($mortgageId,$ppseId)" data-toggle="tab">$name</a>
    </li>
ULLI2;
                    }
                    $i++;
                }
            }
    }
    ?>
</ul>
<script>
    $(document).ready(function(){
        mortgageId = '<?= $mortgageIdF ?>';
        ppesid = '<?= $ppseIdF ?>';
        render(mortgageId,ppesid);
    });//写法1，全称

    function render(mortgageId,ppesid) {
        //-----------------渲染无编辑页面--------------------
                $.get('/project/get-mortgage-view-w-table',{'package_id':package_id,'project_id':project_id,'mortgage_id':mortgageId,'ppesid':ppesid},function (res) {
                    $(".tableWZ").remove();
                    $(".tableS").after(res);
                })
        }
</script>